home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / serial / callback.001 / callback~ / callback / login / execlogin.c < prev    next >
C/C++ Source or Header  |  1996-07-21  |  527b  |  27 lines

  1.  
  2. #include "cblogin.h"
  3.  
  4. static char
  5.     *login_argv[3] =
  6.     {
  7.     NULL,
  8.     NULL,
  9.     NULL,
  10.     };
  11.  
  12. void exec_login(int uid)
  13. {
  14.     log(log_on, "starting exec_login()");
  15.  
  16.     enable_state();            /* load the enable-file. */
  17.  
  18.     login_argv[0] = getlogin();
  19.     login_argv[1] = username(uid);      /* set the username */
  20.  
  21.     log(log_on, "Executing '%s' for '%s'", getlogin(), login_argv[1]);
  22.  
  23.     execv(getlogin(), login_argv);    /* continue execution with login */
  24.         
  25.     error("Can't exec %s", getlogin());    /* should never get here */
  26. }
  27.